/************************************************************
  *  * EaseMob CONFIDENTIAL 
  * __________________ 
  * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. 
  *  
  * NOTICE: All information contained herein is, and remains 
  * the property of EaseMob Technologies.
  * Dissemination of this information or reproduction of this material 
  * is strictly forbidden unless prior written permission is obtained
  * from EaseMob Technologies.
  */

#import "NSDateFormatter+Category.h"

@implementation NSDateFormatter (Category)

+(id)dateFormatterWithFormat:(NSString *)dateFormat{
    NSDateFormatter *dateFormatter = [[self alloc] init];
    dateFormatter.dateFormat = dateFormat;
    return dateFormatter;
}

+(id)formatterWithType:(DateFormatType)dateFormatType{
    NSString * type = @"";
    switch (dateFormatType) {
        case DateFormatTypeFullWithHHmm:
            type = @"yyyy-MM-dd HH:mm";
            break;
        case DateFormatTypeOnlyDate:
            type = @"yyyy-MM-dd";
            break;
        case DateFormatTypeMonthDayWithHHmm:
            type = @"MM-dd HH:mm";
            break;
        case DateFormatTypeMonthDayWithHHmmss:
            type = @"MM-dd HH:mm:ss";
            break;
        default:
            type = @"yyyy-MM-dd HH:mm:ss";
            break;
    }
    return [self dateFormatterWithFormat:type];
}

@end
